﻿using System;
using System.Security.Principal;

namespace Super.Common.Security
{
    public class PrincipalProvider : IPrincipal
    {
        public static PrincipalProvider Currrent
        {
            get
            {
                return System.Threading.Thread.CurrentPrincipal as PrincipalProvider;
            }
        }

        public PrincipalProvider(IdentityProvider identity, string[] roles)
        {
            identity.AuthenticationType = System.Threading.Thread.CurrentPrincipal.Identity.AuthenticationType;
            this.Identity = identity;
            this.Roles = roles;
        }

        public string[] Roles { get; private set; }

        public IIdentity Identity
        {
            get;
            private set;
        }

        public bool IsInRole(string role)
        {
            throw new NotImplementedException();
        }
    }
}